import request from '@/utils/request'
export const getArticles = params =>
  request({
    method: 'GET',
    url: '/v1_0/articles',
    params,
  })
export const getArticleById = article_id =>
  request({
    method: 'GET',
    url: `/v1_0/articles/${article_id}`,
  })
export const addCollect = target =>
  request({
    method: 'POST',
    url: '/v1_0/article/collections',
    data: {
      target,
    },
  })
export const delCollect = target =>
  request({
    method: 'DELETE',
    url: `/v1_0/article/collections/${target}`,
  })
export const addLike = target =>
  request({
    method: 'POST',
    url: '/v1_0/article/likings',
    data: {
      target,
    },
  })
export const delLike = target =>
  request({
    method: 'DELETE',
    url: `/v1_0/article/likings/${target}`,
  })
